| Conditions | 2 |
| Paths | 4 |
| Total Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | export default { |
||
| 11 | } |
||
| 12 | |||
| 13 | return data.sort((a, b) => { |
||
| 14 | let response = 0, |
||
| 15 | ap = a[prop], |
||
| 16 | bp = b[prop]; |
||
| 17 | |||
| 18 | if (ap < bp) { |
||
| 19 | response = direction === "asc" ? -1 : 1; |
||
| 20 | } else if (ap > bp) { |
||
| 21 | response = direction === "asc" ? 1 : -1; |
||
| 22 | } |
||
| 23 | |||
| 24 | return response; |
||
| 25 | }); |
||
| 26 | }, |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Filter objects from array that has key value in values |
||
| 30 | * Example: |
||
| 44 |